web3.js@0.2x.x web3.isConnected
web3.isConnected()
Ethereum ノードへの接続が存在しているかどうかをチェックします。
パラメータ
なし
戻り値
Boolean
サンプルコード
code:example.js
if(web3.isConnected()) {
console.log("Connected to a node");
} else {
console.log("Not connecting to a node");
}
動作サンプル
https://piyolab.github.io/sushiether/web3.js_v0.2x.x/web3/web3.isConnected/index.html
ソースコード
https://github.com/piyolab/sushiether/blob/master/web3.js_v0.2x.x/web3/web3.isConnected/index.html
参考
https://github.com/ethereum/wiki/wiki/JavaScript-API#web3isconnected
#web3.js@0.2x.x #web3.js